<template>
    <div id="tml">
        <ul class="mui-table-view">
            <li class="mui-table-view-cell mui-media" v-for="item in list">
                <a href="javascript:;">
                    <img class="mui-media-object mui-pull-left" :src="item.img_url">
                    <div class="mui-media-body">
                        {{item.title}}
                        <p class='mui-ellipsis' v-html="item.zhaiyao"></p>
                        <div class="ftime">
                            <span >发表时间：{{item.add_time | datafmt("YYYY-MM-DD HH:mm:ss")}}</span>
                            <span class="lastclick">点击数：{{item.click}}</span>
                        </div>
                    </div>
                </a>
            </li>


        </ul>
    </div>
</template>

<script>
    import address from "../../kits/common.js";
    import { Toast } from "mint-ui";
    export default{
        data(){
            return {
                list:[

                ]
        }
        },
        created(){
            this.getData();
        },
        methods:{
            getData(){
                var url =address.apidomain+"/api/getnewslist";
                this.$http.get(url).then(function (res) {
                    if(res.body.status!=0){
                        Toast( res.body.message );
                        return;
                    }
                    this.list = res.body.message;
                })
            }
        }
    }
</script>
<style scoped>
    .mui-table-view img{
        width: 80px;
        height: 80px;
    }
    .mui-table-view .mui-media-object{
        max-width: 80px;
        line-height:80px;
    }
    .ftime{
        margin-top: 1.5em;
        font-size:12px;
        color: #02C1ED;
    }
    .lastclick{
        margin-left: 40px;
    }
</style>
